import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:fluttermodule/widget/ProductEntity.dart';

class ProductItem extends StatefulWidget {
  ProductItem(this.item);

  final ProductEntity item;

  @override
  _ProductItemState createState() {
    return _ProductItemState();
  }
}

class _ProductItemState extends State<ProductItem> {
  _ProductItemState();

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(boxShadow: [
        BoxShadow(
            color: Color(0xff999999), blurRadius: 2, offset: Offset(0.5, 0.5))
      ], borderRadius: BorderRadius.circular(4), color: Colors.white),

      child: ClipRRect(
        borderRadius: BorderRadius.circular(4),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Container(

              color: Colors.white,
              child: Image(image: AssetImage("images/icon2.png")),
              alignment: Alignment.center,
            ),
            Container(
              padding:
              EdgeInsets.symmetric(horizontal: 15),
              margin: EdgeInsets.symmetric(vertical: 12),
              child: Text(
                '纽崔莱® 益生菌系列组合满7减1',
                style: TextStyle(
                    fontSize: 13,
                    fontWeight: FontWeight.bold),
                maxLines: 2,
                overflow: TextOverflow.ellipsis,
              ),
            ),
            Container(

              margin: EdgeInsets.only(left:15,bottom: 5),
              child: Text(
                '满100减50',
                style: TextStyle(
                    fontSize: 13,
                    color: Colors.deepOrange),
                maxLines: 2,
                overflow: TextOverflow.ellipsis,
              ),
            ),
            Container(
              margin: EdgeInsets.symmetric(vertical: 5),
              child: Row(
                mainAxisAlignment: MainAxisAlignment.start,

                children: <Widget>[
                  Container(
                    margin: EdgeInsets.only(left:15),
//                    width:1,
                    child: Text(
                      '¥220.00',
                      style: TextStyle(
                        fontSize: 13,
                        fontWeight: FontWeight.bold,
                        color: Colors.deepOrangeAccent
                      ),
                    ),
                  ),
                  Container(
                    margin: EdgeInsets.only(left: 10),
                    child: Text(
                      '230.50',
                      style: TextStyle(
                        fontSize:13,
                        color: Colors.black38,
                        decoration:TextDecoration.lineThrough,

                      ),
                    ),
                  )
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}
